package com.chd.driversystem.util.network;

import com.chd.driversystem.util.network.bean.DayData;
import com.chd.driversystem.util.network.bean.MonthData;
import com.chd.driversystem.util.network.bean.ResultMsg;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by feiyu on 17-5-31.
 */

public interface HttpRetrofitAccess {

    /**
     * 登录请求
     * @param username
     * @param password
     * @param status
     * @return
     */
    @POST("login")
    Call<Map<String, Object>> getToken(
            @Query("username") String username,
            @Query("password") String password,
            @Query("status") Integer status
    );

    /**
     * 用户注册
     *
     * @param username
     * @param password
     * @param status
     * @return
     */
    @POST("reg")
    Call<ResultMsg<Map<String, String>>> signUpUser(
            @Query("username") String username,
            @Query("password") String password,
            @Query("status") Integer status
    );

    /**
     * 获取司机列表
     *
     * @param ticket
     * @return
     */
    @GET("driverList")
    Call<ResultMsg<Map<String, List<String>>>> getUserList(
            @Header("ticket") String ticket
    );

    /**
     * 请求指定天数驾驶记录
     *
     * @param ticket
     * @param driverId
     * @param startDate
     * @param endDate
     * @return
     */
    @GET("driver/day/data")
    Call<ResultMsg<DayData>> getDriverDataByDateRange(
            @Header("ticket") String ticket,
            @Query("driverId") String driverId,
            @Query("startDate") String startDate,
            @Query("endDate") String endDate
    );

    /**
     * 请求指定月数驾驶记录
     *
     * @param ticket
     * @param driverId
     * @param startMonth
     * @param endMonth
     * @return
     */
    @GET("driver/month/data")
    Call<ResultMsg<MonthData>> getDriverDataByMonthRange(
            @Header("ticket") String ticket,
            @Query("driverId") String driverId,
            @Query("startMonth") String startMonth,
            @Query("endMonth") String endMonth
    );
}
